package com.tengju.bff.interfaces.covercharge.service.bestsign.convert;


import com.google.common.collect.Maps;
import com.tengju.bff.interfaces.covercharge.entity.vo.Identity4Req;
import com.tengju.bff.interfaces.covercharge.entity.vo.SmsVerificationReq;
import com.tengju.bff.interfaces.covercharge.entity.vo.SmsVerificationVerifyReq;
import com.tengju.bff.interfaces.covercharge.service.bestsign.BestSignClient;

import java.util.Map;

/**
 *@author liang_shi
 *@date 2020/7/13 15:27
 *@description 认证类
 */
public class BestSignAuthConverter {

    /**
     * @param req 短信验证请求
     * @return 业务报文
     */
    public static Map<String, Object> packageIdentity3AuthReq(SmsVerificationReq req,String account) {
        //1.业务报文
        Map<String, Object> bizMap = Maps.newHashMap();
        bizMap.put("account", account);
        bizMap.put("name", req.getName());
        //默认0,表示身份证。现在也只支持身份证
        bizMap.put("identityType", req.getIdCardType());
        bizMap.put("identity", req.getIdCardNo());
        bizMap.put("mobile", req.getMobile());
        return bizMap;
    }

    /**
     * @param req 短信验证请求
     * @return 业务报文
     */
    public static Map<String, Object> packageIdentity3AuthVerifyReq(SmsVerificationVerifyReq req) {
        //1.业务报文
        Map<String, Object> bizMap = Maps.newHashMap();
        bizMap.put("vcode", req.getVcode());
        bizMap.put("personalIdentity3Key", req.getPersonalIdentity3Key());
        return bizMap;
    }

    /**
     * 营业执照OCR识别
     * @param image
     * @return 业务报文
     */
    public static Map<String, Object> businessLicenseOCR(String image) {
        //1.业务报文
        Map<String, Object> bizMap = Maps.newHashMap();
        bizMap.put("image", image);
        return bizMap;
    }

    /**
     * 企业四要素验证
     * @param identity4Req
     * @return 业务报文
     */
    public static Map<String, Object> identity4(Identity4Req identity4Req) {
        //1.业务报文
        Map<String, Object> bizMap = Maps.newHashMap();
        bizMap.put("name", identity4Req.getName());
        bizMap.put("identity", identity4Req.getIdentity());
        bizMap.put("legalPerson", identity4Req.getLegalPerson());
        bizMap.put("legalPersonIdentity",identity4Req.getLegalPersonIdentity());
        return bizMap;
    }
}
